﻿using Microsoft.VisualStudio.TestTools.UnitTesting;
using HW_e1;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

namespace HW_e1.Tests
{
    [TestClass()]
    public class OrderServiceTests
    {
        [TestMethod()]
        public void addOrderTest()
        {
            OrderService myorders = new OrderService();
            order my = new order();
            order result = new order();
            my.Id = 2022;
            my.date = 20220617;
            my.Customer = "小明";
            my.setMoney();
            result = my;

            Assert.AreEqual(result, my);
        }




        [TestMethod()]
        public void ExportTest()
        {

            OrderService myorders = new OrderService();
            myorders.Export();
            bool Result = true;
            Assert.IsTrue(Result);

        }

        [TestMethod()]
        public void ImportTest()
        {
            OrderService myorders = new OrderService();
            myorders.Import();
            bool Result = true;
            Assert.IsTrue(Result);

        }

        [TestMethod()]
        public void removeOrderTest()
        {
            OrderService myorders = new OrderService();
            order my = new order();
            order result = new order();
            my.Id = 2022;
            my.date = 20220617;
            my.Customer = "小明";

            result = my;

            Assert.AreEqual(result, my);
        }

        [TestMethod()]
        public void reOrderTest()
        {
            OrderService myorders = new OrderService();
            order my = new order();
            order result = new order();
            order neworder = new order();
            my.Id = 2022;
            my.date = 20220617;
            my.Customer = "小明";

            my.setMoney();
            result = my;
            neworder = my;

            Assert.AreEqual(result, neworder);

        }

        [TestMethod()]
        public void searchOrderTest()
        {
            OrderService myorders = new OrderService();
            order my = new order();
            bool result;
            my.Id = 2022;
            my.date = 20220617;
            my.Customer = "小明";
            my.setMoney();
            result = true;

            Assert.IsTrue(result);

        }
    }
}